//
//  DoctorInfoView.m
//  QuickCure
//
//  Created by 凉气的Mac on 16/9/13.
//  Copyright © 2016年 haoge. All rights reserved.
//

#import "DoctorInfoView.h"

@implementation DoctorInfoView



-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        
        //设置界面
        [self setupUI];
        
    }
    return self;
}

#pragma mark --
#pragma mark --设置界面
-(void)setupUI{
    
    //医生姓名
    UILabel *doctorNameLabel = [[UILabel alloc]init];
    
    doctorNameLabel.text = @"马医生";
    
    doctorNameLabel.font = BOLDFONT(17);
    
    [self addSubview:doctorNameLabel];
    
    [doctorNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.left.equalTo(self).offset(15);
        
    }];
    
    //医生职位
    UILabel *positionLabel = [self addLabelWithString:@"主任医师"];
    
    [positionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.bottom.equalTo(doctorNameLabel);
        
        make.left.equalTo(doctorNameLabel.mas_right).offset(15);
        
    }];
    
    //所属医院
    UILabel *hospitalLabel = [self addLabelWithString:@"上海长征医院"];
    
    [hospitalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(doctorNameLabel.mas_bottom).offset(15);
        
        make.left.equalTo(doctorNameLabel);
        
    }];
    
    
    //反馈按钮
    UIButton *rightBtn = [[UIButton alloc]init];
    
    [rightBtn setTitle:@"提交反馈" forState:UIControlStateNormal];
    
    [rightBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    
    [rightBtn.titleLabel setFont:kFONT15];
    
    [rightBtn setBackgroundColor:[UIColor colorWithRed:0.053 green:0.755 blue:0.770 alpha:1.000]];
    
    rightBtn.layer.cornerRadius = 3;
    
    rightBtn.clipsToBounds = YES;
    
    [self addSubview:rightBtn];
    
    [rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.height.equalTo(@35);
        
        make.width.equalTo(@80);
        
        make.centerY.equalTo(self);
        
        make.right.equalTo(self).offset(-20);
        
    }];

    
    
    

}

-(UILabel *)addLabelWithString:(NSString *)string{

    UILabel *label = [[UILabel alloc]init];
    
    label.font = FONT(14);

    label.text = string;
    
    label.textColor = [UIColor colorWithWhite:0.800 alpha:1.000];
    
    [self addSubview:label];
    
    return label;
}



@end




















